import {useStore} from "~/composables/useStore";

export default defineNuxtRouteMiddleware(to => {
    const userStore = useStore()
    if( to.path !== '/login' && ! userStore.token ) {
        abortNavigation("401 Unauthorized!")
        return navigateTo('/login')
    }
})